package org.originit.factory.core.io;

import java.io.*;

public class FileSystemResource implements Resource{

    private final String path;

    public FileSystemResource(String path) {
        this.path = path;
    }

    @Override
    public InputStream getInputStream() throws IOException {
        File file = new File(this.path);
        if (!file.exists()) {
            throw new FileNotFoundException();
        }
        return new FileInputStream(file);
    }
}
